package com.huayecai.mapper;

import com.huayecai.pojo.Emp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Mapper
public interface EmpMapper {
    @Select("select COUNT(*) from emp left join dept on emp.dept_id = dept.id")
    Long getTotal();

    @Select("select emp.*, dept.name deptName from emp left join dept\n" +
            "    on emp.dept_id = dept.id order by emp.update_time desc limit #{page}, #{pageSize}")
    List<Emp> findAll(Integer page, Integer pageSize);
}
